package com.zaaach.citypicker.util;

import com.zaaach.citypicker.model.City;

import java.util.Comparator;

/**
 * sort by a-z
 */
public class CityComparator implements Comparator<City> {
    @Override
    public int compare(City lhs, City rhs) {
        String a = lhs.getPinyin().substring(0, 1);
        String b = rhs.getPinyin().substring(0, 1);
        return a.compareTo(b);
    }
}
